﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:conv="clr-namespace:Rio.Manager.Application.Converters">

    <conv:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <conv:BitmapImageConverter x:Key="BitmapImageConverter" />

    <DataTemplate x:Key="TabHeaderTemplate">
        <StackPanel HorizontalAlignment="Center"
                    Margin="0"
                    VerticalAlignment="Center"
                    Orientation="Horizontal">
            <Image Source="{Binding TabIcon, Converter={StaticResource BitmapImageConverter}}"
                   VerticalAlignment="Center"
                   MaxWidth="22"
                   MaxHeight="22" />
            <StackPanel Orientation="Horizontal">
                <TextBlock VerticalAlignment="Center"
                           Text="{Binding TabTitle, Mode=OneWay}"
                           HorizontalAlignment="Left" />
                <TextBlock VerticalAlignment="Center"
                           HorizontalAlignment="Left"
                           Text="*"
                           Margin="1,0,0,0"
                           Visibility="{Binding IsEdited, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}" />
            </StackPanel>
            <Button Visibility="{Binding CanCloseTab, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}"
                    VerticalAlignment="Center"
                    Width="16"
                    Height="16"
                    Margin="10,0,3,0"
                    Command="{Binding CloseTabWithConfirmationCommand, Mode=TwoWay}">
                <TextBlock TextWrapping="Wrap"
                           Text="X"
                           FontWeight="Bold"
                           FontStyle="Italic"
                           FontSize="8"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center" />
            </Button>
        </StackPanel>
    </DataTemplate>
</ResourceDictionary>